﻿namespace Baula.TextGen.Framework.Tools
{
    public static class Factory
    {
        static Factory()
        {
            Instance = new DefaultFactory();
        }

        private static IFactory Instance { get; set; }

        public static void SetFactory(IFactory factory)
        {
            Instance = factory;
        }

        public static PartTemplate CreatePartTemplate()
        {
            return Instance.CreatePartTemplate();
        }

        public static PartTemplate CreatePartTemplate(string headingLine)
        {
            return Instance.CreatePartTemplate(headingLine);
        }

        internal static Document CreateDocument(DocumentTemplate documentTemplate)
        {
            return Instance.CreateDocument(documentTemplate);
        }

        public static Part CreatePart(PartTemplate partTemplate)
        {
            return Instance.CreatePart(partTemplate);
        }
    }
}